package com.zhongyouyun.wx.wxapplet.cqyc.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongyouyun.admin.model.MenuModel;
import com.zhongyouyun.cqyc.model.ModuleSetModel;
import com.zhongyouyun.cqyc.pojo.NoticePojo;
import com.zhongyouyun.cqyc.service.ModuleSetService;
import com.zhongyouyun.other.model.PageRequest;
import com.zhongyouyun.other.model.Result;
import com.zhongyouyun.utils.QueryUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("wx/wxapplet/cqyc/moduleset")
@Api(value = "烟草城区-微信小程序模块设置操作", tags = {"烟草城区-微信小程序模块设置操作"})
public class WxAppletModuleSetController {
    @Autowired
    private ModuleSetService moduleSetService;

    @GetMapping("/findList")
    @ResponseBody
    @ApiOperation(value = "模块设置列表", notes = "模块设置列表")
    public Result<List<ModuleSetModel>> findList() {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.orderByAsc("order");
        List<ModuleSetModel> list = moduleSetService.selectList(queryWrapper);
        if (null != list && list.size() > 0) {
            return Result.<List<ModuleSetModel>>builder().message("成功").status(0).data(list).build();
        } else {
            return Result.<List<ModuleSetModel>>builder().status(0).build();
        }
    }
}
